﻿

using System.Text.Json.Serialization;

namespace Simple.Services
{
    public class ParentInputModel : ModelBase
    {
        /// <summary>
        /// 主键
        /// </summary>
        public Guid? Id { get; set; }

        /// <summary>
        /// 幼儿id
        /// </summary>
        public Guid? ChildId { get; set; }

        /// <summary>
        /// 与幼儿关系
        /// </summary>
        public EnumParentRelationship Relationship { get; set; }

        /// <summary>
        /// 家长名称
        /// </summary>
        [Required(ErrorMessage = "家长名称不能为空")]
        public string? Name { get; set; }

        /// <summary>
        /// 手机号码
        /// </summary>
        [Required(ErrorMessage = "手机号码不能为空")]
        public string? PhoneNumber { get; set; }

        /// <summary>
        /// 工作单位
        /// </summary>
        public string? Workplace { get; set; }

        /// <summary>
        /// 学历
        /// </summary>
        public int? Degree { get; set; }
        /// <summary>
        /// 考勤机卡号
        /// </summary>
        public string? MachineCardNumber { get; set; }

        /// <summary>
        /// 是否主成员
        /// </summary>
        public bool IsPrincipalMember { get; set; }


        public override void ConfigureMapper(Profile profile)
        {
            profile.CreateMap<Parent, ParentInputModel>();

            profile.CreateMap<ParentInputModel, Parent>();

        }
    }

    public class UpdatePersonalInfoInput
    {
        /// <summary>
        /// 主键
        /// </summary>
        [Required(ErrorMessage = "家长id不能为空")]
        public Guid? ParentId { get; set; }

        /// <summary>
        /// 家长名称
        /// </summary>
        public string? Name { get; set; }

        /// <summary>
        /// 幼儿id
        /// </summary>
        public Guid? ChildId { get; set; }

        /// <summary>
        /// 与幼儿关系
        /// </summary>
        [JsonConverter(typeof(JsonStringEnumConverter))]
        public EnumParentRelationship? Relationship { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [JsonConverter(typeof(JsonStringEnumConverter))]
        public GenderType? GenderType { get; set; }

        /// <summary>
        /// 头像id
        /// </summary>
        public Guid? ImgId { get; set; }

        /// <summary>
        /// 工作单位
        /// </summary>
        public string? Workplace { get; set; }

        /// <summary>
        /// 学历
        /// </summary>
        public int? Degree { get; set; }
        /// <summary>
        /// 考勤机卡号
        /// </summary>
        public string? MachineCardNumber { get; set; }

        /// <summary>
        /// 是否主成员
        /// </summary>
        public bool? IsPrincipalMember { get; set; }
    }

    public class WeChatQueryModel
    {
        public string? PhoneNumber { get; set; }
    }

    public class AppParentQuery
    {
        public Guid? UserId { get; set; }

        public int? UserType { get; set; }
    }
}

